/**
 * player_tools ：作为play的扩展使用
 * @ps:;卧槽，文件内容实在太大了啊
 * @pm::出牌人，牌号，下一个牌的号码 ,摸牌人
 * @input_uid , 吃碰牌取消摸牌或手打出摸牌；input_uid有值；重跑摸牌，没值，是888；所以重跑没有小牌可以移动
 */
function play_draw_input_nobodyget( input_uid , card_number , next_card_number , chi_peng_fail ){
    /*************************************   如果是吃取消或者碰取消，就不用执行下面这段了  ***********************************/
    if( chi_peng_fail == 0 && input_uid != 888 ){
        //进行当前桌面上那张没人要的牌的移动操作
        add_bp( card_number , PL_Room_Play.MP_P.x , PL_Room_Play.MP_P.y , input_uid , true );
    }
    /*************************************   如果是吃取消或者碰取消，就不用执行上面这段了  ***********************************/

    //桌面底牌数量-1
    PL_Room_Play.draw_dipai_number( GAME_DP_NUM-- );
    //处理牌在各家的显示的位置
    if( GAME_MOP_UID == PB_USER_UID ){
        PL_Room_Play.MOPAI_BG2  = cc.Sprite.create('res/pai/'+ PAI_HAO[next_card_number] +'.png');
        PL_Room_Play.MOPAI_BG   = cc.Sprite.create( "res/mopai_bj.png" );
        PL_Room_Play.MOPAI_BG2.setScale(0.2);PL_Room_Play.MOPAI_BG.setScale(0.2);
        PL_Room_Play.MOPAI_BG2.x = PL_Room_Play.realy_size.width / 2;PL_Room_Play.MOPAI_BG.x = PL_Room_Play.realy_size.width / 2;
        PL_Room_Play.MOPAI_BG2.y = PL_Room_Play.realy_size.height - 150;PL_Room_Play.MOPAI_BG.y = PL_Room_Play.realy_size.height - 150;
        PL_Room_Play.addChild( PL_Room_Play.MOPAI_BG2 , 1000000 );PL_Room_Play.addChild( PL_Room_Play.MOPAI_BG , 1000000 );
        PL_Room_Play.MOPAI_BG2.runAction( cc.MoveTo.create( 0.1 , cc.p(  PL_Room_Play.MOPAI_BG2.x , PL_Room_Play.realy_size.height / 2 + 50 ) ) );
        PL_Room_Play.MOPAI_BG.runAction( cc.MoveTo.create( 0.1 , cc.p(  PL_Room_Play.MOPAI_BG.x , PL_Room_Play.realy_size.height / 2 + 50 ) ) );
        PL_Room_Play.MOPAI_BG2.setScale(0.9);PL_Room_Play.MOPAI_BG.setScale(0.9);
    }else{
        //初始化一张背景小牌（默认位置在底牌墩的位置）
        PL_Room_Play.MOPAI_YANGAI = cc.Sprite.create( "res/cd_normalBG.png" );
        PL_Room_Play.MOPAI_YANGAI.setScale(0.2);
        PL_Room_Play.MOPAI_YANGAI.x = PL_Room_Play.realy_size.width / 2;
        PL_Room_Play.MOPAI_YANGAI.y = PL_Room_Play.realy_size.height - 150;
        PL_Room_Play.addChild( PL_Room_Play.MOPAI_YANGAI , 1000000 );
        if( GAME_MOP_UID == ROOM_WS_XJ ){//如果是下家摸牌
            PL_Room_Play.MOPAI_YANGAI.runAction( cc.MoveTo.create( 0.3 , cc.p(  PL_Room_Play.realy_size.width - 200 ,  200 )) );
        }
        if( GAME_MOP_UID == ROOM_WS_SJ ){//如果是上家摸牌
            PL_Room_Play.MOPAI_YANGAI.runAction( cc.MoveTo.create( 0.3 , cc.p(  200 ,  PL_Room_Play.realy_size.height - 200) ) );
        }
        if( GAME_MOP_UID == ROOM_WS_DM ){//如果是对家摸牌
            PL_Room_Play.MOPAI_YANGAI.runAction( cc.MoveTo.create( 0.3 , cc.p(  PL_Room_Play.realy_size.width - 200 , PL_Room_Play.realy_size.height - 200 ) ) );
        }
        PL_Room_Play.MOPAI_YANGAI.setScale(0.6);
    }
}
function play_eat_pai( chi_pai , card_number , input_uid ){
    cc.log("我点击了吃牌操作，接下来就是吃牌的显示问题解决。。。。");
    var xiaopai_name = "";
    var base_width   = PL_Room_Play.realy_size.width - 100;
    var base_height  = PL_Room_Play.realy_size.height  / 2 - 20 ;
    var L1_count     = base_width;
    var Chi_L1       = "";
    var Chi_L2       = "";
    var Chi_L3       = "";
    var Last_Chi     = "";//最终吃的字符串
    //不管是否有比牌，第一个肯定是可以直接循环遍历出来的
    for( var i = 0 ; i < chi_pai.length ; i++ ){
        //给这三张牌添加一个背景试试
        var chupai_bg = cc.Sprite.create('res/room/chupai_bj.png');
        chupai_bg.setScale(0.98);
        chupai_bg.x   = base_width - (i*80) - 2;
        chupai_bg.y   = base_height + 73;
        PL_Room_Play.addChild( chupai_bg );
        //遍历三张牌
        xiaopai_name  = chi_pai[i][0] <= 10 ? 'x' + chi_pai[i][0] : 'd' + (chi_pai[i][0]-10);
        var temp_p1 = cc.Sprite.create('res/pai/xiao/' + xiaopai_name + '.png');//0肯定是第一个牌
        temp_p1.x   = base_width - (i*80);
        temp_p1.y   = base_height;
        xiaopai_name = chi_pai[i][1] <= 10 ? 'x' + chi_pai[i][1] : 'd' + (chi_pai[i][1]-10);
        var temp_p2 = cc.Sprite.create('res/pai/xiao/' + xiaopai_name + '.png');//1肯定是第二个牌
        temp_p2.x   = base_width - (i*80);
        temp_p2.y   = base_height + 73;
        xiaopai_name = card_number <= 10 ? 'x' + card_number : 'd' + (card_number-10);
        var temp_p3 = cc.Sprite.create('res/pai/xiao/' + xiaopai_name + '.png');//card_number是指当前被吃的这个牌；这个牌面是在最顶上
        temp_p3.x   = base_width - (i*80);
        temp_p3.y   = base_height + 146;
        temp_p1.setScale(0.6);temp_p1.my_name = i;temp_p1.layer = chi_pai[i].layer;temp_p1.jibenchi = chi_pai[i][0] + "_" + chi_pai[i][1] + "_" + card_number;//设置归属墩以及本蹲共有几比？
        temp_p2.setScale(0.6);temp_p2.my_name = i;temp_p2.layer = chi_pai[i].layer;temp_p2.jibenchi = chi_pai[i][0] + "_" + chi_pai[i][1] + "_" + card_number;//设置归属墩以及本蹲共有几比？
        temp_p3.setScale(0.6);temp_p3.my_name = i;temp_p3.layer = chi_pai[i].layer;temp_p3.jibenchi = chi_pai[i][0] + "_" + chi_pai[i][1] + "_" + card_number;//设置归属墩以及本蹲共有几比？
        PL_Room_Play.addChild( temp_p1 , 8888 );
        PL_Room_Play.addChild( temp_p2 , 8888 );
        PL_Room_Play.addChild( temp_p3 , 8888 );
        All_B0_Layer.push( temp_p1);All_B0_Layer.push( temp_p2);All_B0_Layer.push(temp_p3);All_B0_Layer.push( chupai_bg );
        //给每一个牌添加一个点击事件属性 - 1比框
        var temp_listen = cc.EventListener.create({
            event:cc.EventListener.TOUCH_ONE_BY_ONE,
            swallowTouches:true,
            onTouchBegan:function(touch,event){
                var target = event.getCurrentTarget();
                var locationInNode = target.convertToNodeSpace(touch.getLocation());
                var s      = target.getContentSize();
                var rect   = cc.rect(0, 0, s.width, s.height);
                if (cc.rectContainsPoint(rect, locationInNode)) {
                    Chi_L1 = target.jibenchi;
                    if( target.layer == 1 ){//该种吃牌没有牌可以比
                        for( var y = 0 ; y < All_B3_Layer.length ; y++ ){PL_Room_Play.removeChild(All_B3_Layer[y] );}//清除所有3比框
                        for( var y = 0 ; y < All_B2_Layer.length ; y++ ){PL_Room_Play.removeChild(All_B2_Layer[y] );}//清除所有2比框
                        for( var y = 0 ; y < All_B1_Layer.length ; y++ ){PL_Room_Play.removeChild(All_B1_Layer[y] );}//清除所有1比框
                        implement_eat_action(input_uid , card_number , Chi_L1);
                    }else if( target.layer == 2 ){//该种吃牌有一层比可以选择
                        for( var y = 0 ; y < All_B3_Layer.length ; y++ ){PL_Room_Play.removeChild(All_B3_Layer[y] );}//清除所有3比框
                        for( var y = 0 ; y < All_B2_Layer.length ; y++ ){PL_Room_Play.removeChild(All_B2_Layer[y] );}//清除所有2比框
                        for( var y = 0 ; y < All_B1_Layer.length ; y++ ){PL_Room_Play.removeChild(All_B1_Layer[y] );}//清除所有1比框
                        var data = chi_pai[ target.my_name ]['bi_1'];
                        //计算当前的偏移量
                        base_width = L1_count - chi_pai.length * 80 - 30;
                        //设定初始值
                        for( var x = 0 ; x < data.length ; x++ ){
                            //给这三张牌添加一个背景试试
                            var chupai_bg = cc.Sprite.create('res/room/chupai_bj.png');
                            chupai_bg.setScale(0.98);
                            chupai_bg.x   = base_width - (x*80) - 2;
                            chupai_bg.y   = base_height + 73;
                            PL_Room_Play.addChild( chupai_bg );
                            //遍历三张牌
                            xiaopai_name  = data[x][0] <= 10 ? 'x' + data[x][0] : 'd' + (data[x][0]- 10);
                            var temp_p1   = cc.Sprite.create('res/pai/xiao/' + xiaopai_name + '.png');//0肯定是第一个牌
                            temp_p1.x     = base_width - (x*80);
                            temp_p1.y     = base_height;
                            xiaopai_name  = data[x][1] <= 10 ? 'x' + data[x][1] : 'd' + (data[x][1]- 10);
                            var temp_p2   = cc.Sprite.create('res/pai/xiao/' + xiaopai_name + '.png');//1肯定是第二个牌
                            temp_p2.x     = base_width - (x*80);
                            temp_p2.y     = base_height + 73;
                            xiaopai_name  = card_number <= 10 ? 'x' + card_number : 'd' + (card_number-10);
                            var temp_p3   = cc.Sprite.create('res/pai/xiao/' + xiaopai_name + '.png');//card_number是指当前被吃的这个牌；这个牌面是在最顶上
                            temp_p3.x     = base_width - (x*80);
                            temp_p3.y     = base_height + 146;
                            temp_p1.setScale(0.6);temp_p1.jibenchi = data[x][0] + "_" + data[x][1] + "_" + card_number;
                            temp_p2.setScale(0.6);temp_p2.jibenchi = data[x][0] + "_" + data[x][1] + "_" + card_number;
                            temp_p3.setScale(0.6);temp_p3.jibenchi = data[x][0] + "_" + data[x][1] + "_" + card_number;
                            PL_Room_Play.addChild( temp_p1 , 8888 );
                            PL_Room_Play.addChild( temp_p2 , 8888 );
                            PL_Room_Play.addChild( temp_p3 , 8888 );
                            All_B1_Layer.push( temp_p1);All_B1_Layer.push( temp_p2);All_B1_Layer.push(temp_p3);All_B1_Layer.push( chupai_bg );
                            //绑定二比点击事件
                            var temp_listen = cc.EventListener.create({
                                event:cc.EventListener.TOUCH_ONE_BY_ONE,
                                swallowTouches:true,
                                onTouchBegan:function(touch,event){
                                    var target = event.getCurrentTarget();
                                    var locationInNode = target.convertToNodeSpace(touch.getLocation
                                    ());
                                    var s      = target.getContentSize();
                                    var rect   = cc.rect(0, 0, s.width, s.height);
                                    if (cc.rectContainsPoint(rect, locationInNode)) {
                                        Chi_L2 = Chi_L1 + "," + target.jibenchi;
                                        implement_eat_action( input_uid , card_number , Chi_L2 );
                                    }
                                },
                            });
                            cc.eventManager.addListener( temp_listen ,  temp_p1 );
                            cc.eventManager.addListener( temp_listen.clone() ,  temp_p2 );
                            cc.eventManager.addListener( temp_listen.clone() ,  temp_p3 );
                        }
                    }else if( target.layer == 3 ){
                        for( var y = 0 ; y < All_B1_Layer.length ; y++ ){PL_Room_Play.removeChild(All_B1_Layer[y] );}//清除所有1比框
                        for( var y = 0 ; y < All_B2_Layer.length ; y++ ){PL_Room_Play.removeChild(All_B2_Layer[y] );}//清除所有2比框
                        for( var y = 0 ; y < All_B3_Layer.length ; y++ ){PL_Room_Play.removeChild(All_B3_Layer[y] );}//清除所有3比框
                        var data   = chi_pai[ target.my_name ]['bi_1'];
                        //计算当前的偏移量
                        base_width = L1_count - chi_pai.length * 80 - 30;
                        //给这三张牌添加一个背景试试
                        var chupai_bg = cc.Sprite.create('res/room/chupai_bj.png');
                        chupai_bg.setScale(0.98);
                        chupai_bg.x   = base_width - 2;
                        chupai_bg.y   = base_height + 73;
                        PL_Room_Play.addChild( chupai_bg );
                        //遍历三张牌
                        xiaopai_name  = data[0] <= 10 ? 'x' + data[0] : 'd' + (data[0]-10);
                        var temp_p1   = cc.Sprite.create('res/pai/xiao/' + xiaopai_name + '.png');//0肯定是第一个牌
                        temp_p1.x     = base_width ;
                        temp_p1.y     = base_height;
                        xiaopai_name  = data[1] <= 10 ? 'x' + data[1] : 'd' + (data[1]-10);
                        var temp_p2   = cc.Sprite.create('res/pai/xiao/' + xiaopai_name + '.png');//1肯定是第二个牌
                        temp_p2.x     = base_width;
                        temp_p2.y     = base_height + 73;
                        xiaopai_name  = card_number <= 10 ? 'x' + card_number : 'd' + (card_number-10);
                        var temp_p3   = cc.Sprite.create('res/pai/xiao/' + xiaopai_name + '.png');//card_number是指当前被吃的这个牌；这个牌面是在最顶上
                        temp_p3.x     = base_width;
                        temp_p3.y     = base_height + 146;
                        temp_p1.setScale(0.6);temp_p1.my_name = target.my_name;temp_p1.jibenchi = data[0] + "_" + data[1] + "_" + card_number;
                        temp_p2.setScale(0.6);temp_p2.my_name = target.my_name;temp_p2.jibenchi = data[0] + "_" + data[1] + "_" + card_number;
                        temp_p3.setScale(0.6);temp_p3.my_name = target.my_name;temp_p3.jibenchi = data[0] + "_" + data[1] + "_" + card_number;
                        PL_Room_Play.addChild( temp_p1 , 8888 );
                        PL_Room_Play.addChild( temp_p2 , 8888 );
                        PL_Room_Play.addChild( temp_p3 , 8888 );
                        All_B2_Layer.push( temp_p1);All_B2_Layer.push( temp_p2);All_B2_Layer.push(temp_p3);All_B2_Layer.push( chupai_bg );
                        //给当前的1比加上事件；看是否有2比可以选择
                        //绑定吃事件。。。。。
                        var temp_listen = cc.EventListener.create({
                            event:cc.EventListener.TOUCH_ONE_BY_ONE,
                            swallowTouches:true,
                            onTouchBegan:function(touch,event){
                                var target = event.getCurrentTarget();
                                var locationInNode = target.convertToNodeSpace(touch.getLocation());
                                var s      = target.getContentSize();
                                var rect   = cc.rect(0, 0, s.width, s.height);
                                if (cc.rectContainsPoint(rect, locationInNode)) {
                                    Chi_L2 = target.jibenchi;
                                    for( var y = 0 ; y < All_B3_Layer.length ; y++ )
                                    {PL_Room_Play.removeChild( All_B3_Layer[y] );}//清除所有3比框
                                    var data   = chi_pai[ target.my_name ]['bi_1']['bi_2'];
                                    //计算当前的偏移量
                                    base_width = L1_count - chi_pai.length * 80 - 30 - 110;
                                    //设定初始值
                                    var chupai_bg = cc.Sprite.create('res/room/chupai_bj.png');
                                    chupai_bg.setScale(0.98);
                                    chupai_bg.x   = base_width;
                                    chupai_bg.y   = base_height + 73;
                                    PL_Room_Play.addChild( chupai_bg );
                                    //遍历三张牌
                                    xiaopai_name  = data[0] <= 10 ? 'x' + data[0] : 'd' + (data[0]-10);
                                    var temp_p1   = cc.Sprite.create('res/pai/xiao/' + xiaopai_name + '.png');//0肯定是第一个牌
                                    temp_p1.x     = base_width;
                                    temp_p1.y     = base_height;
                                    xiaopai_name  = data[1] <= 10 ? 'x' + data[1] : 'd' + (data[1]-10);
                                    var temp_p2   = cc.Sprite.create('res/pai/xiao/' + xiaopai_name + '.png');//1肯定是第二个牌
                                    temp_p2.x     = base_width;
                                    temp_p2.y     = base_height + 73;
                                    xiaopai_name  = card_number <= 10 ? 'x' + card_number : 'd' + (card_number-10);
                                    var temp_p3   = cc.Sprite.create('res/pai/xiao/' + xiaopai_name + '.png');//card_number是指当前被吃的这个牌；这个牌面是在最顶上
                                    temp_p3.x     = base_width;
                                    temp_p3.y     = base_height + 146;
                                    temp_p1.setScale(0.6);temp_p1.jibenchi = data[0] + "_" + data[1] + "_" + card_number;
                                    temp_p2.setScale(0.6);temp_p2.jibenchi = data[0] + "_" + data[1] + "_" + card_number;
                                    temp_p3.setScale(0.6);temp_p3.jibenchi = data[0] + "_" + data[1] + "_" + card_number;
                                    PL_Room_Play.addChild( temp_p1 , 10888 );
                                    PL_Room_Play.addChild( temp_p2 , 10888 );
                                    PL_Room_Play.addChild( temp_p3 , 10888 );
                                    All_B3_Layer.push( temp_p1);All_B3_Layer.push(temp_p2);All_B3_Layer.push( temp_p3);All_B3_Layer.push( chupai_bg );
                                    //绑定3比点击事件
                                    var temp_listen = cc.EventListener.create({
                                        event:cc.EventListener.TOUCH_ONE_BY_ONE,
                                        swallowTouches:true,
                                        onTouchBegan:function(touch,event){
                                            var target = event.getCurrentTarget();
                                            var locationInNode = target.convertToNodeSpace
                                            (touch.getLocation());
                                            var s      = target.getContentSize();
                                            var rect   = cc.rect(0, 0, s.width, s.height);
                                            if (cc.rectContainsPoint(rect, locationInNode)) {
                                                //链接1层跟2层
                                                Chi_L3 = Chi_L1 + "," + Chi_L2 + "," + target.jibenchi;
                                                implement_eat_action( input_uid , card_number , Chi_L3 );
                                            }
                                        },
                                    });
                                    cc.eventManager.addListener( temp_listen ,  temp_p1 );
                                    cc.eventManager.addListener( temp_listen.clone() ,  temp_p2 );
                                    cc.eventManager.addListener( temp_listen.clone() ,  temp_p3 );
                                }
                            },
                        });
                        cc.eventManager.addListener( temp_listen ,  temp_p1 );
                        cc.eventManager.addListener( temp_listen.clone() ,  temp_p2 );
                        cc.eventManager.addListener( temp_listen.clone() ,  temp_p3 );
                    }
                }
            },
        });
        cc.eventManager.addListener( temp_listen ,  temp_p1 );
        cc.eventManager.addListener( temp_listen.clone() ,  temp_p2 );
        cc.eventManager.addListener( temp_listen.clone() ,  temp_p3 );
    }

}
/**
 * 代表执行了吃的操作;这里的吃通用手牌吃跟摸牌吃
 * @param eat_who_uid   吃了谁的
 * @param eat_card      吃的什么牌
 * @param eat_pai       怎么个吃法？
 * @注意：这里如果eat_who_uid 为888的情况下，则为吃摸牌；所以这里需要调用后端的y方法
 */
function implement_eat_action(  eat_who_uid , eat_card , eat_pai ){
    //发送吃牌信息至服务器
    switch ( eat_who_uid ){
        case 888:
            PB_WS.send("y:" + PB_USER_UID + ":" + ROOM_ID + ":" + eat_card + ":" + eat_pai);//摸弃牌吃
            break;
        default:
            PB_WS.send("t:" + PB_USER_UID + ":" + ROOM_ID + ":" + eat_who_uid + ":" + eat_card + ":" + eat_pai);//手打牌吃
            break;
    }
    //点了吃以后，过的按钮就要消失了
    PL_Room_Play.removeChild( PL_Room_Play.BTN_CLOSE );
    //被吃的那张牌消失于桌面
    for( var i = 0 ; i < GAME_OUT_PAI.length ; i++ ){PL_Room_Play.removeChild( GAME_OUT_PAI[i] );}
    //消失所有的吃&比牌界面
    for( var y = 0 ; y < All_B0_Layer.length ; y++ ){PL_Room_Play.removeChild(All_B0_Layer[y] );}//清除所有1比框
    for( var y = 0 ; y < All_B1_Layer.length ; y++ ){PL_Room_Play.removeChild(All_B1_Layer[y] );}//清除所有1比框
    for( var y = 0 ; y < All_B2_Layer.length ; y++ ){PL_Room_Play.removeChild(All_B2_Layer[y] );}//清除所有2比框
    for( var y = 0 ; y < All_B3_Layer.length ; y++ ){PL_Room_Play.removeChild(All_B3_Layer[y] );}//清除所有3比框
    //同时对手牌中的牌进行吃的操作
    var xiaopai_name = "";
    var pai_zu       = eat_pai.split(",");
    for( var i = 0; i < pai_zu.length ; i++ ){
        var pai_temp = pai_zu[i].split("_");
        for( var x = 0; x < pai_temp.length ; x++ ){
            //去除手中的手牌
            for( var y = 1; y < PL_Room_Play.PPP_pai.length ;y++ ) {
                if( PL_Room_Play.PPP_pai[y].paihao == pai_temp[x] ){
                    PL_Room_Play.removeChild( PL_Room_Play.PPP_pai[y] );
                    DUN_PS[PL_Room_Play.PPP_pai[y].dijidun-1]--;//牌墩上的牌数-1
                    PL_Room_Play.PPP_pai.splice(y,1);
                    break;
                }
            }
            //小牌移动
            xiaopai_name = pai_temp[x] <= 10 ? 'ss' + pai_temp[x] : 's' + (pai_temp[x]-10);
            var temp     = cc.Sprite.create('res/pai/xp/' + xiaopai_name + '.png');
            temp.x       = PL_Room_Play.realy_size.width - 200;
            temp.y       = PL_Room_Play.realy_size.height / 2;
            PL_Room_Play.addChild( temp );
            temp.runAction( cc.MoveTo.create( 0.3 , cc.p(  40 * ZJ_XP_COUNT ,  SMALL_PAI_H *(x) - 500 + 745 ) ) );
            MISCE.push( temp );//添加杂项
        }
        ZJ_XP_COUNT++;
    }
    JUST_CHI       = true;//将刚刚吃的这个变量设置为true
    GAME_NOW_BTN_C = 0;
    PL_Room_Play.BTN_CLOSE = null;
    draw_play_paireset();
}
/**
 * 吃牌确认被执行
 * 因为吃的效果在自己吃了以后就做了，所以再回传本方法的时候，是不需要在执行吃的；
 * JUST_CHI 默认为false，也就是如果是回放吃的话，那么这里是要执行的
 * @param eat_uid  谁吃的牌？
 * @param eat_pai  怎么吃的什么牌？？
 * @param eat_card_number 吃的什么牌?
 */
function play_draw_eat_success( eat_uid , eat_pai , eat_card_number ){
    //删除本张废牌的背景牌&以及公示牌
    PL_Room_Play.removeChild( PL_Room_Play.MOPAI_YANGAI );
    if( PL_Room_Play.MOPAI_BG2 != null ){ PL_Room_Play.removeChild(PL_Room_Play.MOPAI_BG2) ;}
    if( PL_Room_Play.MOPAI_BG != null ) { PL_Room_Play.removeChild(PL_Room_Play.MOPAI_BG) ; }
    //按理说只要进行了吃牌确认，那么所有玩家的按钮应该都是要消失的才对
    delete_all_btn();
    if( eat_uid != PB_USER_UID){
        //被吃的那张牌消失于桌面
        for( var i = 0 ; i < GAME_OUT_PAI.length ; i++ ){PL_Room_Play.removeChild( GAME_OUT_PAI[i] );}
        //中心点生成一张小牌，后面用来移动到吃牌人的头像那里去，然后消失
        xiaopai_name = eat_card_number <= 10 ? 'ss' + eat_card_number : 's' + (eat_card_number-10);
        var xiaopai  = cc.Sprite.create('res/pai/xp/' + xiaopai_name + '.png');
        xiaopai.x    = PL_Room_Play.realy_size.width / 2;
        xiaopai.y    = PL_Room_Play.realy_size.height / 2;
        PL_Room_Play.addChild( xiaopai , 0 );
        //切割牌组
        var pai_zu       = eat_pai.split(",");
        //根据不同的人吃，把小牌移动到不同的人那个位置去
        if( eat_uid == ROOM_WS_XJ ){
            xiaopai.runAction(cc.MoveTo.create(0.3, cc.p( PL_Room_Play.realy_size.width - 50 , 50 ) ));
            for( var i = 0; i < pai_zu.length ; i++ ){
                var pai_temp = pai_zu[i].split("_");
                for( var x = 0; x < pai_temp.length ; x++ ){
                    //小牌移动
                    xiaopai_name = pai_temp[x] <= 10 ? 'ss' + pai_temp[x] : 's' + (pai_temp[x]-10);
                    var temp     = cc.Sprite.create('res/pai/xp/' + xiaopai_name + '.png');
                    temp.x       = PL_Room_Play.realy_size.width - 400;
                    temp.y       = PL_Room_Play.realy_size.height / 2;
                    PL_Room_Play.addChild( temp );
                    temp.runAction( cc.MoveTo.create( 0.2 , cc.p(  PL_Room_Play.realy_size.width -  40 * XJ_XP_COUNT , 42 * x + RB_XP_HEIGHT ) ) );
                    MISCE.push( temp );//添加杂项
                }
                XJ_XP_COUNT++;
            }
        }
        if( eat_uid == ROOM_WS_SJ ){
            xiaopai.runAction(cc.MoveTo.create(0.3, cc.p( 50 , PL_Room_Play.realy_size.height - 70 ) ));
            for( var i = 0; i < pai_zu.length ; i++ ){
                var pai_temp = pai_zu[i].split("_");
                for( var x = 0; x < pai_temp.length ; x++ ){
                    //小牌移动
                    xiaopai_name = pai_temp[x] <= 10 ? 'ss' + pai_temp[x] : 's' + (pai_temp[x]-10);
                    var temp     = cc.Sprite.create('res/pai/xp/' + xiaopai_name + '.png');
                    temp.x       = 400;
                    temp.y       = PL_Room_Play.realy_size.height - 400;
                    PL_Room_Play.addChild( temp );
                    temp.runAction( cc.MoveTo.create( 0.2 , cc.p(  40 * SJ_XP_COUNT , PL_Room_Play.realy_size.height - TOP_LEFT_XP_HEIGHT -  SMALL_PAI_H * x ) ) );
                    MISCE.push( temp );//添加杂项
                }
                SJ_XP_COUNT++;
            }
        }
        if( eat_uid == ROOM_WS_DM ){
            xiaopai.runAction(cc.MoveTo.create(0.3, cc.p( PL_Room_Play.realy_size.width - 50 , PL_Room_Play.realy_size.height - 70 ) ));
            for( var i = 0; i < pai_zu.length ; i++ ){
                var pai_temp = pai_zu[i].split("_");
                for( var x = 0; x < pai_temp.length ; x++ ){
                    //小牌移动
                    xiaopai_name = pai_temp[x] <= 10 ? 'ss' + pai_temp[x] : 's' + (pai_temp[x]-10);
                    var temp     = cc.Sprite.create('res/pai/xp/' + xiaopai_name + '.png');
                    temp.x       = PL_Room_Play.realy_size.width - 400;
                    temp.y       = PL_Room_Play.realy_size.height - 400;
                    PL_Room_Play.addChild( temp );
                    temp.runAction( cc.MoveTo.create( 0.2 , cc.p(  PL_Room_Play.realy_size.width -  40 * DM_XP_COUNT , PL_Room_Play.realy_size.height - TOP_LEFT_XP_HEIGHT -  SMALL_PAI_H * x ) ) );
                    MISCE.push( temp );//添加杂项
                }
                DM_XP_COUNT++;
            }
        }
    }else{
        if(  JUST_CHI == false ){
            cc.log("你进入了回放吃，所以这里要执行");
            //点了吃以后，过的按钮就要消失了
            PL_Room_Play.removeChild( PL_Room_Play.BTN_CHI );
            PL_Room_Play.removeChild( PL_Room_Play.BTN_PENG );
            PL_Room_Play.removeChild( PL_Room_Play.BTN_CLOSE );
            //被吃的那张牌消失于桌面
            for( var i = 0 ; i < GAME_OUT_PAI.length ; i++ ){PL_Room_Play.removeChild( GAME_OUT_PAI[i] );}
            //同时对手牌中的牌进行吃的操作
            var xiaopai_name = "";
            var pai_zu       = eat_pai.split(",");
            for( var i = 0; i < pai_zu.length ; i++ ){
                var pai_temp = pai_zu[i].split("_");
                for( var x = 0; x < pai_temp.length ; x++ ){
                    //去除手中的手牌
                    for( var y = 1; y < PL_Room_Play.PPP_pai.length ;y++ ) {
                        if( PL_Room_Play.PPP_pai[y].paihao == pai_temp[x] ){
                            PL_Room_Play.removeChild( PL_Room_Play.PPP_pai[y] );
                            DUN_PS[PL_Room_Play.PPP_pai[y].dijidun-1]--;//牌墩上的牌数-1
                            PL_Room_Play.PPP_pai.splice(y,1);
                            break;
                        }
                    }
                    //小牌移动
                    xiaopai_name = pai_temp[x] <= 10 ? 'ss' + pai_temp[x] : 's' + (pai_temp[x]-10);
                    var temp     = cc.Sprite.create('res/pai/xp/' + xiaopai_name + '.png');
                    temp.x       = PL_Room_Play.realy_size.width - 200;
                    temp.y       = PL_Room_Play.realy_size.height / 2;
                    PL_Room_Play.addChild( temp );
                    temp.runAction( cc.MoveTo.create( 0.3 , cc.p(  40 * ZJ_XP_COUNT , 42*(x) - 500 + LB_XP_HEIGHT ) ) );
                    MISCE.push( temp );//添加杂项
                }
                ZJ_XP_COUNT++;
            }
            GAME_NOW_BTN_C = 0;
            PL_Room_Play.BTN_CLOSE = null;
        }
    }
    //进行trip操作
    show_tripAND_sound( 'chi' , eat_uid );
    draw_play_paireset();
}